Skip to content

fix: BasePath not included in AWS::ApiGateway::BasePathMapping when defined as ["/"] #3740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 26, 2025

Conversation

mbfreder
Copy link
Contributor

Issue #, if available

The "AWS::Serverless::Api" SAM resource type creates an "AWS::ApiGateway::BasePathMapping" resource when processed.
When the 'BasePath' sub-property of this resource type is defined as ["/"] , the "AWS::ApiGateway::BasePathMapping" resource in the processed template does NOT include the 'BasePath' property.

Description of changes

transform ["/"] into "" in the processed template.

Description of how you validated changes

Updated unit tests to cover the edge case

Checklist

Examples?

Please reach out in the comments if you want to add an example. Examples will be
added to sam init through aws/aws-sam-cli-app-templates.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mbfreder mbfreder requested a review from a team as a code owner March 25, 2025 21:09
@vicheey
Copy link
Contributor

vicheey commented Mar 25, 2025

For context, this is the previous PR that contain change that this current PR try to address : #3719

@valerena
Copy link
Contributor

It's probably better to add new test files instead of modifying the existing ones. It's always good to keep old tests relatively steady, so we can confirm that we're not breaking any of the old cases that were already working fine.

@valerena valerena merged commit 8c8f7b0 into aws:develop Mar 26, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants